CC = g++
LD = g++
prog = libhandler.so
SRC = \
	event_handler.h \
	event_worker.cpp \
	event_worker.h \
	handler_factory.h \
	handler_factory.cpp \
	multicaster.cpp \
	multicaster.h \
	null_deleter.h
OBJ = \
	event_worker.o \
	handler_factory.o \
	multicaster.o 

LDFLAGS = -shared -lboost_thread -lboost_regex -L../network -lnetwork -L../model -lmodel
CFLAGS = -std=c99 -g -fPIC -DPIC -fvar-tracking  -I/usr/include/libxml2

all: $(prog)

${prog}: $(OBJ)
	$(LD) $(LDFLAGS) $(OBJ) -o $(prog)

%.o: %.cpp
	$(CC) $(CFLAGS) -c $< -o $@

%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@

clean:
	rm $(OBJ)
	rm $(prog)

run:
	./$(prog)
